package com.chen.staffjoy.company.controller;

import com.chen.staffjoy.commonlib.base.BaseController;
import com.chen.staffjoy.company.entity.Directory;
import com.chen.staffjoy.company.service.IDirectoryService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * 企业雇员账户目录表 Controller
 *
 * @author ChenTian
 */ 
@RestController
@RequestMapping("/directory")
public class DirectoryController extends BaseController {

	@Resource
	private IDirectoryService directoryService;

	@GetMapping("/getById/{id}")
	public Directory getById(@PathVariable String id) {
		Directory result = directoryService.findById(id);
		return result;
	}

	@DeleteMapping("/deleteById/{id}")
	public void deleteById(@PathVariable String id) {
		directoryService.deleteById(id);
	}

	@PostMapping("/save")
	public Directory save(@RequestBody Directory model) {
		Directory result = directoryService.save(model);
		return result;
	}

}
